﻿using Hong.IRepository.IRepository_AttendanceManagement;
using Hong.Model.SysDomain.Model_AttendanceManagement;
using Hong.Model.SysDomain.Model_AttendanceManagement.Sta;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hong.Business.Business_AttendanceManagement
{
    public class AttendanceBusiness
    {
        #region 构造器注入
        private readonly IAttendanceRepository _attendanceRepository;
        public AttendanceBusiness(IAttendanceRepository attendanceRepository)
        {
            _attendanceRepository = attendanceRepository;
        }
        #endregion

        #region 添加申请
        public int AddRequest(Guid? currentStaffId, string currentStaffName, RequestInfo requestInfo)
        {
            return _attendanceRepository.AddRequest(currentStaffId, currentStaffName, requestInfo);
        }
        #endregion

        #region 获取请假类型
        public List<StaDictionaries> GetDictionaries()
        {
            return _attendanceRepository.GetDictionaries();
        }
        #endregion

        #region 获取申请列表
        public List<ViewRequestInfo> GetRequestInfos( string type)
        {
            return _attendanceRepository.GetRequestInfos(type);
        }
        #endregion

        #region 审批
        public int Approval(InstantiationInfo instantiationInfo)
        {
            return _attendanceRepository.Approval(instantiationInfo);
        }
        #endregion

        #region 节假日设置

        #region 添加节假日
        public int AddHolday(HolidaysInfo holidaysInfo)
        {
            return _attendanceRepository.AddHolday(holidaysInfo);
        }
        #endregion

        #region 显示节假日
        public List<ViewHolday> Showholday(string year)
        {
            return _attendanceRepository.Showholday(year);
        }
        #endregion

        #region 删除节假日
        public int DelHoliday(int holidayID)
        {
            return _attendanceRepository.DelHoliday(holidayID);
        }
        #endregion

        #endregion

        #region 特殊工作日设置

        #region 添加特殊工作日
        public int AddWorkDay(WorkdayInfo workdayInfo)
        {
            return _attendanceRepository.AddWorkDay(workdayInfo);
        }
        #endregion

        #region 显示特殊工作日
        public List<ViewWorkDay> ShowWorkDay(string year)
        {
            return _attendanceRepository.ShowWorkDay(year);
        }
        #endregion

        #region 删除特殊工作日
        public int DelWorkDay(int workdayID)
        {
            return _attendanceRepository.DelWorkDay(workdayID);
        }
        #endregion

        #endregion

    }
}
